<?php foreach ($aryNewsCategory as $key => $value) {?>
         <?php if($value['news_category_level'] == 1) {?>
            <?php if($value['news_category_id'] == $categoryId) {?>
                <div class="navhead">
                    <span  class="cpointer selected" onclick="AdminController.getListNews('date-down','<?php echo $value['news_category_id'];?>','0','1');">
                        <?php echo $value['news_category_name'];?>
                    </span>
                </div>
                <?php if(isset ($aryNewsSubCategory[0])) {?>
                    <div class="subnav">
                        <ul class="submenu">
                    <?php foreach ($aryNewsSubCategory as $key => $sub) {?>

                                <li>
                                    <a class="<?php echo ($sub['news_category_id'] == $subCategoryId) ? 'cpointer p-sub-selected' : 'cpointer sub-noselect';?>" onclick="AdminController.getListNews('date-down', '<?php echo $value['news_category_id'];?>','<?php echo $sub['news_category_id'];?>','1');"><?php echo $sub['news_category_name'];?></a>
                                </li>

                    <?php } ?>
                        </ul>
                    </div>
                <?php } ?>
            <?php }else{ ?>
                <div class="navhead">
                    <span  class="cpointer noselect" onclick="AdminController.getListNews('date-down','<?php echo $value['news_category_id'];?>','0','1');">
                        <?php echo $value['news_category_name'];?>
                    </span>
                </div>
            <?php } ?>
            
     <?php } ?>
<?php } ?>